package com.example.controller;

import com.example.common.Result;
import com.example.entity.User;
import com.example.service.UserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class WebController {
    @Resource
    private UserService userService;

    @PostMapping("/loginStudent")
    public Result loginStudent(@RequestBody User user) {
        User dbuser = userService.login(user);
        return Result.success(dbuser);
    }
}
